﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace PhysicsEngine.Dynamics
{
  public class Material
  {
    public float Density { get; private set; }
    public float Restitution { get; private set; }

    public Material(float density, float restitution)
    {
      Contract.Requires<ArgumentException>(density > 0);
      Contract.Requires<ArgumentException>(restitution >= 0);
      Contract.Ensures(Density == density);
      Contract.Ensures(Restitution == restitution);

      Density = density;
      Restitution = restitution;
    }

    [ContractInvariantMethod]
    private void ObjectInvariant()
    {
      Contract.Invariant(Density > 0);
      Contract.Invariant(Restitution >= 0);
    }
  }
}
